using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CarMove : MonoBehaviour
{
    public GameObject player;

    public Transform bornPoint;

    public GameUI gameUI;

    private void Start()
    {
        Soundmgr.Instance.PlayMusicByName("Car",transform.position, 1.0f);
        gameUI.bosshealthBar.gameObject.SetActive(false);
        transform.DOLocalMoveX(-6f, -0.5f).OnComplete(
            () =>
            {
                GameObject.Instantiate(player, bornPoint.position, Quaternion.identity);

                Camera.main.GetComponent<CameraMove>().enabled = true;

                Destroy(gameObject, 0.5f);
            }
        );
    }
}
